package com.example.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DemoTask {

//    @Scheduled(cron = "0/5 * *  * * ? ")   //每5秒执行一次
    public void test() {
        System.out.println("当前时间：" + new Date());
    }
}
